package com.cq.hd.product.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.product.api.dto.SearchDto;
import com.cq.hd.product.api.dto.SearchRecordPageDto;
import com.cq.hd.product.api.vo.SearchRecordPageVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "hd-o2o-product-service", contextId = "search-record-api")
public interface TbSearchRecordApi {

    // 最近10个历史搜索词
    @GetMapping("/product/searchRecord/pageSearchRecord")
    Result<Page<SearchRecordPageVo>> pageSearchRecord(@SpringQueryMap SearchRecordPageDto searchRecordPageDto);

    // 搜索
    @PostMapping("/product/searchRecord/search")
    Result<Object> search(@RequestBody SearchDto searchDto);

    // 删除历史搜索词
    @DeleteMapping("/product/searchRecord/delete")
    Result<Boolean> deleteSearchRecord(@RequestParam("userId") Long userId, @RequestParam("id") Long id);
}
